package com.itxialu.reggie.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itxialu.reggie.entity.Employee;
import com.itxialu.reggie.mapper.EmployeeMapper;
import com.itxialu.reggie.service.EmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @author shkstart
 * @create 2022-09-25 11:53
 */
@Slf4j
@Service
public class EmployeeServiceimpl extends ServiceImpl<EmployeeMapper, com.itxialu.reggie.entity.Employee> implements EmployeeService {

    @Autowired
    private EmployeeService employeeService;


    @Override
    public Employee Selectlogin(Employee employee) {
        //String username = employee.getUsername();
        //根据页面提交过来的用户名查数据库
        LambdaQueryWrapper<Employee> wrapper = new LambdaQueryWrapper<>();//mybatis-plus条件构造器
        wrapper.eq(Employee::getUsername, employee.getUsername());//设置条件
        System.out.println("查数据库");
        Employee one = employeeService.getOne(wrapper);
        System.out.println(one);
        return one;
    }

    //员工信息保存

}
